package com.sdp.core.bizc.vo;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class BusinessContext implements Serializable {

	
	private static final long serialVersionUID = 1L;

	private boolean isSuccess = true;

	private String message;

	private Map<Object, Object> dataMap = new HashMap<Object, Object>();

	public boolean isSuccess() {
		return isSuccess;
	}

	public void setSuccess(boolean isSuccess) {
		this.isSuccess = isSuccess;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public void put(Object key, Object value) {
		dataMap.put(key, value);
	}

	public void put(Class<?> clazz, Object value) {
		dataMap.put(clazz.getName(), value);
	}

	@SuppressWarnings("unchecked")
	public <T> T get(Object key) {
		return (T) dataMap.get(key);
	}

	@SuppressWarnings("unchecked")
	public <T> T get(Class<?> clazz) {
		return (T) dataMap.get(clazz.getName());
	}

	public Object remove(Object key) {
		return dataMap.remove(key);
	}

	public boolean containsKey(Object key) {
		return dataMap.containsKey(key);
	}

	public void clear() {
		dataMap.clear();
	}
}
